#!/bin/bash

# crontab set
#@hourly ~/.local/bin/disk_usage.sh ~/.disk_usage_hourly.log
#@daily ~/.local/bin/disk_usage.sh ~/.disk_usage_daily.log
#@weekly ~/.local/bin/disk_usage.sh ~/.disk_usage_weekly.log
#@monthly ~/.local/bin/disk_usage.sh ~/.disk_usage_monthly.log

LOGFILE=${1-"/home/user/.disk_usage.log"}
echo -e $(date  +"\n%Y-%m-%d %H:%M:%S") >> ${LOGFILE} && df -h -t ext4 -t nfs -t xfs -t fuse.KodoFS --output=source,fstype,size,used,avail,pcent,file,target >> ${LOGFILE}

